import random

from commom import skill_prefixes, skill_suffixes


class Skill:
    def __init__(self, skill_name, damage, critical):
        self.skill_name = skill_name
        self.damage = damage
        self.critical = critical

    @classmethod
    def random_skill(cls):
        skill_name = random.choice(skill_prefixes) + random.choice(['的', '之']) + random.choice(skill_suffixes)
        damage = random.randint(20, 50)
        critical = random.randint(10, 40)
        return cls(skill_name, damage, critical)

    def __repr__(self):
        return f'{self.skill_name}-{self.damage}-{self.critical}'
